package com.zj.demomybatisplus.model;

import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;

/**
 * @Auther: zj
 * @Date: 2019/3/24 11:39
 * @Description:
 */
public class User extends Model {

    private Integer id;

    private String username;

    private Integer age;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() { //重写toString() 方法，便于打印消息
        return String.format( "User[id=%d, username='%s', age=%d]",
                id, username, age );
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}

